﻿var htmlload = "<table style='width:100%;height:100%;'><tr><td style='text-align:center;'><img src='images/bigloading.gif' alt=''/></td></tr></table>";
var htmlmoneyin = "<div>充值金额:<input type='text' />&nbsp;&nbsp;最小充值金额<span>" + sysConfigMinMoneyIn + "</span>元</div><div><input type='submit' class='ui-state-hover' value='提交' onclick='moneyIn()' /><span id='errorMsgMoney' class='greenfont'></span></div>";

function showMoneyInDialog() {
    $("#div_dialog_money").dialog("option", "title", "充值");
    $("#div_dialog_money").html(htmlmoneyin);
    if (!$("#div_dialog_money").dialog("isOpen")) {
        $("#div_dialog_money").dialog("open");
    }
    setTimeout('$("#div_dialog_money input[type=text]").focus()', 500);       //获取焦点
}

function moneyIn() {    
    showMoneyErrorMsg("");
    var amount = parseFloat($("#div_dialog_money input[type=text]").val());
    if (isNaN(amount)) {
        showMoneyErrorMsg("金额输入有误");
        $("#div_dialog_money input[type=text]").select()
        return;
    }
    if (amount < sysConfigMinMoneyIn) {
        showMoneyErrorMsg("充值金额不能低于" + sysConfigMinMoneyIn + "元");
        $("#div_dialog_money input[type=text]").select()
        return;
    }
    if (!userInfo || userInfo.ID < 1) {
        showMoneyErrorMsg("用户未登录");
        return;
    }
    $("#div_dialog_money").dialog("close");    
    window.open("MoneyIn.aspx?price=" + amount, "_blank");
}